/*************************************************************************
    > File Name: test.c
    > Author: ma6174
    > Mail: ma6174@163.com 
    > Created Time: Tue 04 Mar 2025 10:19:12 PM CST
 ************************************************************************/

#include<stdio.h>
#include<string.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>


int main()
{	
	printf("stdin->fd: %d\n",stdin->_fileno);
	printf("stdout->fd: %d\n",stdout->_fileno);
	printf("stderr->fd: %d\n",stderr->_fileno);
	
	FILE* fp = fopen("log.txt","w");
	if(fp==NULL) return 1;
	printf("fd->_fileno: %d\n",fp->_fileno);
	
	FILE* fp1 = fopen("log1.txt","w");
	if(fp==NULL) return 1;
	printf("fd1->_fileno: %d\n",fp1->_fileno);
	
	FILE* fp2 = fopen("log2.txt","w");
	if(fp==NULL) return 1;
	printf("fd2->_fileno: %d\n",fp2->_fileno);

	fclose(fp);
	fclose(fp1);
	fclose(fp2);


	return 0;
}
